<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>锐信内容管理系统-修改用户信息</title>
<%@include file="/WEB-INF/pages/common/taglibs.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/screen.css" /> 
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/list.css" />
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/datepicker/datepicker.css" /> 
<script type="text/javascript" src="${ctx}resources/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="${ctx}resources/js/datepicker/wdatepicker.js"></script>
</head>
<style>
	.sing {
	width: 200px;
	height: 25px;
}
input{
	border:#999 1px solid;
}
</style>
<script type="text/javascript">
$().ready(function() {
	$("#signupForm").validate({
		rules: {
			realName: {
				required: true,
				minlength:2
				
			},
			email: {
				required: true,
				email:true
			},
			nickname: {
				required: true
			},
			birthday: {
				required: true
			}
		},
		messages: {
			realName: {
				required: "用户名不能为空！"
			},
			email: {
				required: "*email不能为空！",
				email:"*email格式不正确！"
			},
			nickname: {
				required: "*确认密码不能为空！"
			},
			birthday: {
				required: "*生日不能为空！"
			}
		}
	});


});
</script>
<body>
<div align="center" style="padding-top:20px;">
	<form  id="signupForm" method="post" action="${ctx}account/modify.htm">
	<input type="hidden" value="${user.id}" name="id">
	<input type="hidden" value="${pageNo}" name="pageNo">
		<table width="95%" cellpadding="0" cellspacing="1" align="center" id="bordertable">
		<tr height="30px;"  class="tr0">
			<td width="40%" style="text-align: right;"><label>用户名:</label></td>
			<td width="60%">${user.username}</td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="text-align: right;"><label>姓名:</label></td>
			<td ><input name="realName" value="${user.realName}" class="sing"></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="text-align: right;"><label>邮箱:</label></td>
			<td ><input name="email" value="${user.email}" class="sing"></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td style="text-align: right;"><label>地址:</label></td>
			<td><input name="address" value="${user.address}" class="sing"></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="text-align: right;"><label>昵称:</label></td>
			<td ><input name="nickname" value="${user.nickname}" class="sing"></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="text-align: right;"><label>电话:</label></td>
			<td ><input name="phone" value="${user.phone}" class="sing"></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td style="text-align: right;"><label>性别:</label></td>
			<td><input type="radio"  name="sex" value="男" ${user.sex eq "男"?"checked":""}/>男&nbsp;&nbsp;<input type="radio" value="女" name="sex" ${user.sex eq "女"?"checked":""}/>女</td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td style="text-align: right;"><label>状态:</label></td>
			<td><input type="radio"  name="enabled" value="1" ${user.enabled?"checked":""}/>正常&nbsp;&nbsp;<input type="radio" value="0" name="enabled" ${user.enabled?"":"checked"}/>禁用</td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td style="text-align: right;"><label>权限:</label></td>
			<td>
				<input type="radio" value="1" name="special" ${user.special?"checked":""}/>管理员&nbsp;&nbsp;<input type="radio" value="0" name="special"  ${user.special?"":"checked"}/>普通用户
			</td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="text-align: right;"><label>生日:</label></td>
			<td><input name="birthday"  value="<fmt:formatDate value="${user.birthday}" pattern="yyyy-MM-dd"/>" id="birthday"  class="Wdate" type="text" readonly="readonly" onClick="WdatePicker()"></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="text-align: right;"><label>学历:</label></td>
			<td><select name="degree" style="height: 24px">
				<option  value="小学" ${user.degree eq "小学"?"selected":""}>小学</option>
				<option  value="中学" ${user.degree eq "中学"?"selected":""}>中学</option>
				<option  value="大专" ${user.degree eq "大专"?"selected":""}>大专</option>
				<option  value="本科" ${user.degree eq "本科"?"selected":""}>本科</option>
				<option  value="研究生" ${user.degree eq "研究生"?"selected":""}>研究生</option>
				<option  value="博士" ${user.degree eq "博士"?"selected":""}>博士</option>
				<option  value="博士后" ${user.degree eq "博士后"?"selected":""}>博士后</option>
			</select></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td style="text-align: right;"><label>角色:</label></td>
			<td style="text-align: left;">
					<div style="width: 50%"><c:forEach items="${roles}" var="role">
						<input type="checkbox" name="rids" value="${role.id}"<c:forEach var="ur" items="${user.roles}"><c:if test="${role.id==ur.id}">checked</c:if></c:forEach>>${role.name}
					</c:forEach></div>
			</td>
		</tr>
		<tr height="50px;"  class="tr0">
			<td style="padding-right: 20px;text-align: right;"><input class="button" type="submit" value="提交"/></td>
			<td style="padding-left: 20px;text-align: left;"><input class="button"  type="reset" value="取消" onclick="javascript:history.back();"/></td>
		</tr>
		</table>
</form>
	  
</div>
</body>
</html>